﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>ui_bubble</title>
    <script src="jquery.js" type="text/javascript"></script>
    <link href="ui_bubble.css" rel="stylesheet" type="text/css" />
    <script src="ui_bubble.js" type="text/javascript"></script>
</head>
<body>
<input type="button" value="示例" onclick="call_demo()" />
<input type="button" value="示例" onclick="call_demo2()" />

<script type="text/javascript">
function call_demo()
{
	showTip("<textarea />.");
}

function call_demo2()
{

}
/*工具函数*/

function showTip(content)
{
    //传递引用，motified by jlq
    //var p = getMousePosition();
	var p = getMousePosition;
	return new ui_bubble({
		content: content,
		pointX: p.x,
		pointY: p.y
	});
}

function getMousePosition(ev)
{
    ev = ev || window.event;
	if(ev.pageX || ev.pageY)
		return {x:ev.pageX, y:ev.pageY};     
	else
	return {         
		x: ev.clientX + document.body.scrollLeft - document.body.clientLeft,         
		y: ev.clientY + document.body.scrollTop  - document.body.clientTop 
	}; 
} 
</script>
</body>
</html>
